import { BasicColumn, FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';

export const columns: BasicColumn[] = [
  // 列定义
  {
    title: '标题',
    dataIndex: ['ext', 'autoGenTitle'],
  },
  {
    title: '摘要',
    dataIndex: ['ext', 'f_title'],
  },
  {
    title: '发起人',
    dataIndex: ['ext', 'u_realName'],
  },
  {
    title: '发起时间',
    dataIndex: 'createTime',
  },
  {
    title: '发起人所属部门',
    dataIndex: ['ext', 'u_deptName'],
  },
  {
    title: '发起人职务',
    dataIndex: ['ext', 'u_postName'],
  },
  {
    title: '定义名称',
    dataIndex: 'displayName',
  },
  {
    title: '定义版本',
    dataIndex: 'version',
  },
  {
    title: '状态',
    dataIndex: 'state',
    customRender: ({ text }) => {
      return render.renderDict(text, 'wf_process_instance_state');
    },
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'm_LIKE_displayName',
    label: '显示名称',
    component: 'Input',
    colProps: {
      xl: 6,
      xxl: 6,
    },
    componentProps: {
      placeholder: '请输入显示名称',
    },
  },
  {
    field: 'm_LIKE_name',
    label: '唯一编码',
    component: 'Input',
    colProps: {
      xl: 6,
      xxl: 6,
    },
    componentProps: {
      placeholder: '请输入唯一编码',
    },
  },
];

export const ccColumns: BasicColumn[] = [
  // 列定义
  {
    title: '标题',
    dataIndex: ['ext', 'autoGenTitle'],
  },
  {
    title: '摘要',
    dataIndex: ['ext', 'f_title'],
  },
  {
    title: '发起人',
    dataIndex: ['ext', 'u_realName'],
  },
  {
    title: '发起时间',
    dataIndex: 'createTime',
  },
  {
    title: '发起人所属部门',
    dataIndex: ['ext', 'u_deptName'],
  },
  {
    title: '发起人职务',
    dataIndex: ['ext', 'u_postName'],
  },
  {
    title: '定义名称',
    dataIndex: 'displayName',
  },
  {
    title: '定义版本',
    dataIndex: 'version',
  },
  {
    title: '状态',
    dataIndex: 'state',
    customRender: ({ text }) => {
      return render.renderDict(text, 'wf_process_instance_state');
    },
  },
];

export const ccSearchFormSchema: FormSchema[] = [
  {
    field: 'm_LIKE_displayName',
    label: '显示名称',
    component: 'Input',
    colProps: {
      xl: 6,
      xxl: 6,
    },
    componentProps: {
      placeholder: '请输入显示名称',
    },
  },
  {
    field: 'm_LIKE_name',
    label: '唯一编码',
    component: 'Input',
    colProps: {
      xl: 6,
      xxl: 6,
    },
    componentProps: {
      placeholder: '请输入唯一编码',
    },
  },
];
